//
//  CrashExceptioinCatcher.m
//  QuickCoin
//
//  Created by tjl on 2016/12/29.
//  Copyright © 2016年 tjl. All rights reserved.
//

#import "CrashExceptioinCatcher.h"
#import "AppDelegate.h"

@implementation CrashExceptioinCatcher

+ (void)startCrashExceptionCatch
{
    // Sets the top-level error-handling function where you can perform last-minute logging before the program terminates.
    NSLog(@"程序执行成功");
    NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); //设置异常Log信息的处理
}

// 提交异常Log信息
void uncaughtExceptionHandler(NSException *exception) {
    
    // 异常Log信息
    NSString *logInfo = [NSString stringWithFormat:@"Crash:\n%@\nStack Trace:\n%@\n",
                         [exception description], [exception callStackSymbols]];
    NSLog(@"%@", logInfo);

}

@end
